﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace SocketTestClient
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入你要连接的服务器的ip地址：");
            string ip = Console.ReadLine();
            Console.WriteLine("请输入你要连接的服务器的端口号：");
            int port = int.Parse(Console.ReadLine());

            //创建套接字
            Socket_Client s = new Socket_Client(ip, port);
            //连接服务器
            s.Connect_Server();
            //接收服务器的消息
            Thread recv = new Thread(s.Recv_Msg_By_Client);
            //给服务器发送消息
            Thread send = new Thread(s.Request_Client);
            recv.Start();
            send.Start();

            recv.Join();
            send.Join();
            Console.ReadKey();
        }
    }
}
